package reflect;

import reflect.annotation.AutoRunClass;
import reflect.annotation.AutoRunMethod;

/**
 * java bean
 */
@AutoRunClass
public class Person {
    private String name = "张三";
    private int age = 22;

    public Person() {
    }
    @AutoRunMethod( 2)
    public void doSome(){System.out.println(name+"做某事");}
    @AutoRunMethod()
    public void sleep(){System.out.println(name+"睡了");}
    @AutoRunMethod()
    public void watchTV(){System.out.println(name+"看电视");
    }
    public void study(){System.out.println(name+"学习");}
    public void playGame(){System.out.println(name+"玩游戏");}
    public void sing(){System.out.println(name+"唱歌");}
    public Person( String name) {
        this.name = name;
    }

    public void sayHello() {
        System.out.println(name + ":hello!");
    }
public void sayHi(){
        System.out.println(name+":"+"hi!");
    }
    public Person(String name, int age) {
        this.name = name;
        this.age = age;
    }
    public void say(String msg){
        System.out.println(name+":"+msg);
    }
    public void say(String msg,int num){
        for (int i = 0; i < num; i++){
            System.out.println(name+":"+msg);
        }
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
    private void hehe(){
        System.out.println("私有方法");
    }

    @Override
    public String toString() {
        return "Person{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}

